import request from '@/utils/request'

/*获取首页信息*/
export const getHome = () =>{
    return request('/index')
}

/*获取首页推荐商品*/
export const getHomeGoods = () =>{
    return request('/advice')
}

/*获取商品分类信息*/
export const getGoodsType = (json) =>{
    return request('/goods/categorys', json);
}

/*获取商品列表*/
export const getGoodsList = (json) =>{
    return request('/goods/list', json);
}

/*获取专区商品列表*/
export const getSpecialList = (json) =>{
    return request('/goods/specialList', json);
}

/*获取传统商品列表*/
export const getTradList = (json) =>{
    return request('/goods/authList', json);
}

/*获取商品详情*/
export const getGoodsDetail = (json) =>{
    return request('/goods/detail', json);
}

/*添加商品,取消收藏*/
export const addCollet = (type, json) =>{
    return request('/uc/collect/'+ type, json);
}

/*商品是否收藏*/
export const isCollet = (json) =>{
    return request('/uc/collect/isCollect', json);
}

/*获取热门搜索*/
export const getSearchHot = (json) =>{
    return request('/goods/getSearchHot', json, 'POST');
}

/*获取用户搜索记录*/
export const getSearchhis = (json) =>{
    return request('/goods/getSearchHistory', json);
}

/*删除用户搜索记录*/
export const delSearchhis = (json) =>{
    return request('/goods/delSearch', json);
}

/*添加商品*/
export const addGoods = (json) =>{
    return request('/uc/cart/add', json);
}

/*减少商品*/
export const redGoods = (json) =>{
    return request('/uc/cart/sub', json);
}

/*获取购物车商品*/
export const getCartGoods = (json) =>{
    return request('/uc/cart/index', json);
}

/*删除购物车商品*/
export const delCartGoods = (json) =>{
    return request('/uc/cart/del', json);
}

/*购物车商品生成预订单*/
export const addPreOrder = (json) =>{
    return request('/order/preSubmit', json);
}

/*生成订单*/
export const addOrder = (json) =>{
    return request('/order/submit', json);
}

/*订单支付回调*/
export const orderPayStatus = (json) =>{
    return request('/order/success', json);
}

/*是否授权*/
export const getIsAuth = (json) =>{
    return request('/uc/isAuth', json);
}


//注册
export const register = (json) =>{
    return request('/login/reg', json);
}
//验证码
export const codes = (json) =>{
    return request('/login/code', json);
}
//登陆
export const login = (json) =>{
    return request('/login/in', json);
}

//忘记密码
export const forget = (json) =>{
    return request('/login/resetPwd', json);
}

//地址列表
export const addresslist = (json) =>{
    return request('/uc/address/list', json);
}
//添加地址
export const addaddress = (json) =>{
    return request('/uc/address/add', json);
}
//删除地址
export const deladdress = (json) =>{
    return request('/uc/address/del', json);
}

//单个信息地址
export const checkaddress = (json) =>{
    return request('/uc/address/initEdit', json);
}
//编辑地址
export const editaddress = (json) =>{
    return request('/uc/address/edit', json);
}
//收藏列表
export const collectlist = (json) =>{
    return request('/uc/collect/list', json);
}
//我的
export const myindex = (json) =>{
    return request('/uc/index', json);
}
//认证中心
export const authpersonal = (json) =>{
    return request('/uc/auth', json);
}
//豆兑换
export const exchange = (json) =>{
    return request('/uc/duihuan', json);
}
//个人信息回显
export const perdata = (json) =>{
    return request('/uc/view', json);
}
//用户偏好列表
export const likedata = (json) =>{
    return request('/uc/like/list', json);
}
//红包券列表
export const redpacklist = (json) =>{
    return request('/uc/coupon/list', json);
}
//卡券兑换
export const cardconvert = (json) =>{
    return request('/market/authCoupon', json);
}
//收入明细
export const incomedata = (json) =>{
    return request('/uc/paylog/list', json);
}
//余额明细
export const blancedata = (json) =>{
    return request('/uc/point/list', json);
}
//订单信息
export const orderlist = (json) =>{
    return request('/uc/order/list', json);
}

//重置
export const resetaddress = (json) =>{
    return request('/uc/address/setDefaultAddress', json);
}

//订单取消
export const removedata = (json) =>{
    return request('/order/cancel', json);
}

//订单收货
export const confirmOrder = (json) =>{
    return request('/order/confirm', json);
}


//修改用户信息
export const changeUser = (json) =>{
    return request('/uc/edit', json);
}

//订单详情
export const orderDetail = (json) =>{
    return request('/uc/order/detail', json);
}

//金额接口
export const priceInter = (json) =>{
    return request('/order/rechange', json);
}

//会员等级
export const vipgradeInter = (json) =>{
    return request('/project/vip', json);
}